﻿@model WineStore.Models.Product
@{
    ViewBag.Title = "CreateProduct";
    Layout = "~/Views/Shared/AdminLayout.cshtml";
}
<!-- Table (TABLE) -->
@section Scripts{
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
}
<h3 class="tit">
    Create Product
</h3>
<fieldset>
    <legend>Create Product</legend>
    @using (Html.BeginForm("CreateProduct", "Product", FormMethod.Post, new { enctype = "multipart/form-data" }))
    { 
        @Html.ValidationSummary(true)
        <table class="nostyle">
            <tbody>
                <tr>
                    <td>
                        CategoryName:<span style="color: Red">(not null)</span>
                    </td>
                    <td>
                        @*name va id phai co gia tri giong ten truong trong database*@
                        @Html.DropDownListFor(model => model.CategoryId, null, "-- CategoryName --", new { style = "width:154px;" })
                    </td>
                    <td style="color: Red;">
                        @Html.ValidationMessageFor(model => model.CategoryId)
                    </td>
                </tr>
                <tr>
                    <td>
                        Product Name:<span style="color: Red">(not null)</span>
                    </td>
                    <td>
                        @*name va id phai co gia tri giong ten truong trong database*@
                        @Html.EditorFor(model => model.ProductName)
                    </td>
                    <td style="color: Red;">
                        @Html.ValidationMessageFor(model => model.ProductName)
                    </td>
                </tr>
                <tr>
                    <td>
                        Product Price:<span style="color: Red">(not null, number format)</span>
                    </td>
                    <td>
                        @Html.EditorFor(model => model.ProductPrice)
                    </td>
                    <td style="color: Red;">
                        @Html.ValidationMessageFor(model => model.ProductPrice)
                    </td>
                </tr>
                <tr>
                    <td>
                        Date Add:<span style="color: Red">(not null, date format)</span>
                    </td>
                    <td>
                        @Html.EditorFor(model => model.DateAdd)
                    </td>
                    <td style="color: Red;">
                        @Html.ValidationMessageFor(model => model.DateAdd)
                    </td>
                </tr>
                <tr>
                    <td>
                        Product Image:<span style="color: Red">(not null)</span>
                    </td>
                    <td>
                        @Html.TextBoxFor(model => model.ProductImage, new { type = "file" })
                    </td>
                    <td style="color: Red;">
                        @Html.ValidationMessageFor(model => model.ProductImage)
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="t-right">
                        <input type="submit" value="Create Product" />
                    </td>
                </tr>
            </tbody>
        </table>
    }
</fieldset>
